package com.cuckoo.mall.thus.goodmultipledetail;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.bgn.baseframe.utils.UiUtil;
import com.bgn.baseframe.utils.imageloader.ImageLoader;
import com.cuckoo.mall.R;
import com.jude.rollviewpager.RollPagerView;
import com.jude.rollviewpager.adapter.LoopPagerAdapter;

/**
 * Created by 伦哥哥 on 2017/6/25.
 */

public class ImageAdapter extends LoopPagerAdapter {
    private String[] data;
    private Context context;

    public ImageAdapter(String[] images, Context activity, RollPagerView viewPager) {
        super(viewPager);
        data = images;
        context = activity;
    }


    @Override
    public View getView(ViewGroup viewGroup, int position) {
        View view = UiUtil.inflate(R.layout.goods_detail_image_item);
        ImageView iv_lunbo_item = view.findViewById(R.id.iv_lunbo_item);
        ImageLoader.load(data[position]).into(iv_lunbo_item);
        return view;
    }

    @Override
    public int getRealCount() {
        return data.length;
    }


}
